package org.ssm.learn;

public class hello2 implements Runnable {
    public hello2() {

    }

    public hello2(String name) {

        this.name = name;

    }

    public void run() {

        for (int i = 0; i < 5; i++) {

            System.out.println(name + "运行");

        }

    }

    public static void main(String[] args) {

        hello h1 = new hello("线程 A");

        Thread demo = new Thread(h1);

        hello h2 = new hello("线程Ｂ");

        Thread demo1 = new Thread(h2);

        demo.start();

        demo1.start();

    }

    private String name;

}
